package main

import (
	"bufio"
	"fmt"
	"os"
)

var all = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

func main() {
	bufin := bufio.NewReader(os.Stdin)
	bufout := bufio.NewWriter(os.Stdout)
	defer bufout.Flush()

	var strin string
	fmt.Fscanf(bufin, "%s\n", &strin)
	in := []byte(strin)
	var needa [26]int
	leftlen := len(in)
	base := 0
	f := 0
	b := 0
	if leftlen < 26 {
		fmt.Println(-1)
		return
	}

	// once
	for {
		if in[b] == '?' {
			base++
		} else {
			needa[in[b]-'A']++
			if needa[in[b]-'A'] == 1 {
				base++
			}
		}
		if b == 25 {
			break
		}
		b++
	}
	var ok bool
	for {
		var empty int
		if base == 26 {
			ok = true
			// for idx := 0; idx != f; idx++ {
			// 	if in[idx] == '?' {
			// 		fmt.Print("A")
			// 	} else {
			// 		fmt.Print(string(in[idx]))
			// 	}
			// }
			for idx := f; idx != b+1; idx++ {
				if in[idx] == '?' {
					for k := empty; ; k++ {
						if needa[k] == 0 {
							in[idx] = all[k]
							empty = k + 1
							break
						}
					}
				}
			}
			for idx := b + 1; idx != len(in); idx++ {
				if in[idx] == '?' {
					in[idx] = 'A'
				}
			}
			break
		}
		f++
		b++
		leftlen--
		if leftlen < 26 {
			fmt.Println(-1)
			break
		}
		if in[f-1] == '?' {
			in[f-1] = 'A'
			base--
		} else {
			needa[in[f-1]-'A']--
			if needa[in[f-1]-'A'] == 0 {
				base--
			}
		}

		if in[b] == '?' {
			base++
		} else {
			if needa[in[b]-'A'] == 0 {
				base++
			}
			needa[in[b]-'A']++
		}
	}
	if ok {
		fmt.Fprintf(bufout, "%s\n", in)
	}
}
